package June12;

import java.util.Scanner;

public class TrangleTest {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		Trangle a = new Trangle();

		while (true) {
			System.out.print("输入三角形第一条边长：");
			a.a = input.nextDouble();
			System.out.print("输入三角形第二条边长：");
			a.b = input.nextDouble();
			System.out.print("输入三角形第三条边长：");
			a.c = input.nextDouble();

			if (a.a + a.b > a.c && a.a + a.c > a.b && a.b + a.c > a.a) {
				break;
			} else {
				System.out.println("此三条边无法构成三角形请重新输入！");
				continue;
			}
		}
		double area = a.area();
		double circum = a.circum();
		System.out.println("三角形的面积为" + area + "周长为" + circum);
	}
}
